borp/sa: Update borp to pass Transaction args through BoulderTypeConverter #8494
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Today, timestamp truncation happens for queries using
*borp.DbMapbut not*borp.Transaction. That means comparisons still see sub-seconds, but inserts into MariaDBDATETIMEcolumns silently truncate them to whole seconds.On MySQL 8, the same queries will still include sub-seconds, but inserts into
DATETIMEcolumns will round to the nearest second instead of truncate. This leads to issues for queries like the one in*StorageAuthority.UpdateCRLShard(). When two CRL updaters write within the same second one may be rounded up to the next second. When the other updater attempts its ownUPDATE .. WHERE thisUpdate <= ?, the condition fails because the stored timestamp now appears to be in the future.Ahead of the transition from ProxySQL + MariaDB to Vitess + MySQL 8 in #8468, update borp (letsencrypt/borp#12) to expose Transaction arguments to the BoulderTypeConverter, allowing it to truncate all timestamps passed through Transactions and keep behavior consistent across
*borp.DbMapand*borp.Transaction, as well as MariaDB and MySQL 8.Part of #7736
Example of truncation vs rounding behavior in MariaDB and MySQL 8, respectively: